#include <stdio.h>
#include "StdThread.h"
#include <pthread.h>
#include <unistd.h>


Mutex *m;
//pthread_cond_t cond = PTHREAD_COND_INITIALIZER;// 静态初始化
Cond *PrintA;
Cond *PrintB;

void * func1(void *arg)
{
    while (1)
    {
        sleep(1);
        printf("A\n");
    }

    return NULL;
}

void * func2(void *arg)
{
    while (1)
    {
        sleep(1);
        printf("B\n");
    }

    return NULL;
}

int main()
{
    
    m = MutexInit();

    Thread * t1 = ThreadInit(func1, NULL);// 两个线程
    Thread * t2 = ThreadInit(func2, NULL);


    ThreadJoin(t1);// 等待结束
    ThreadJoin(t2);
    ClearThread(t1);// 清理
    ClearThread(t2);
    

    return 0;
}